<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/qgh_stylesheet.css" rel="stylesheet">
</block>

<block name="script">
<script type="text/javascript" src="__JS__/banner.js"></script>
</block>

<block name="header">
<header class="panic">
	<div class="container">
		<div class="logo fl"><img src="__IMG__/qgh/logo.png"></div>
		<div class="sub-nav fl">
			<ul>    		
	       		<li><a href="{:U('Qgh/index')}"  {:I('extend') =='' ? "class='active'" : ''}>首页</a></li>
	       		<li><a href="{:U('Qgh/index',array('extend'=>'most'))}" 
	       			{:I('extend') =='most' ? "class='active'" : ''}>折扣最多</a></li>
	       		<li><a href="{:U('Qgh/index',array('extend'=>'last'))}"
	       		{:I('extend') =='last' ? "class='active'" : ''}>最后疯抢</a></li>
	       	</ul>
		</div>
		<div class="search">
			<form action="" method="post" autocomplete="off">
	            <input name="title" class="search-input" placeholder="搜索抢购的商品">
	            <a href="javascript:;" class="search-btn fr">搜索</a>
            </form>
        </div>
	</div>
</header>
<header class="panic-times">
	<div class="container">
		<div class="sub-nav fl">
			<ul>
		<notempty name="spnic_schedule">
       		<volist name="spnic_schedule" id="vo" >							
				<li><a href="#" <eq name="vo['curr']" value="1"> class="active"</eq> ><p>{$vo.hour}开抢</p><span>{$vo.text}</span></a></li>
			</volist>
			<else />
				<li><a href="#"><p>暂无抢购</p><span> </span></a></li>
		</notempty>
	       	</ul>
		</div>
	</div>
</header>
</block>

<block name="body">
<div class="container main">
	<div class="col-xs-9 list">
		<div class="row">
			<div class="sub-menu fl">
				<ul>
					<volist name=":getCategoryTree()" id='vo'>
						<li>
						<a  class="title" href="{:U('Index?fid='.$vo['id'])}">{$vo.title}</a>
						<div class="sub-menu-list">
							<volist name="vo._child" id="child">
								 <a href="{:U('Index?cid='.$child['id'])}">{$child.title}</a>
					 		</volist>
						</div>
						</li>
					</volist>	
				</ul>
			</div>
			<div class="banner">
		   		<ul class="banner-img">
		   			<volist name="adlist" id="vo">
						<li><a href="#"><img src="{$vo.image}"></a></li>
					</volist>
		   		</ul>
		   		<div class="banner-btn"></div>
		   		<div class="banner-page">
		   			<a href="javascript:;" class="prev"><</a>
		   			<a href="javascript:;" class="next">></a>
		   		</div>
		   	</div>
		</div>
		<div class="row">
		
			<h4 >限时限量 疯狂抢购<span id="time_countdown" class=" fr endtime"
			   data="{$end_time|time_format='m/d/Y H:s:m'}">距离本场结束：</span></h4>
			   <script>
		function countdown(){		
				var self = $("#time_countdown");
				var endtime = $("#time_countdown").attr('data');
				
				var nowtime = new Date().getTime();				
				endtime = new Date(endtime).getTime();
				overtime = endtime - nowtime;				
				
			 if (overtime > 0) {
					seconds = overtime/1000;
			        minutes = Math.floor(seconds/60);
			        hours = Math.floor(minutes/60);
			        
			        r_second = Math.floor(seconds % 60);
			        r_minute = minutes % 60;
					
					self.html('距结束：'+ 
					"<i>"+hours+"</i>:<i>"+r_minute+"</i>:<i>"+r_second+"</i>");
				} else {
					self.html('已结束');
				}		
			
			timer = setTimeout("countdown()", 1000);
		}
		countdown();
		</script>
			<div class="form-group">
				<volist name="p_list" id="vo">
					<div class="qgh-item">
						<div class="qgh-img">
							<a href="{:U('Product/detail',array('id'=>$vo['id']))}"><img src="{$vo.image}"></a>
						</div>
						<div class="qgh-desc">
							<div class="tlt">
								<a href="{:U('Product/detail',array('id'=>$vo['id']))}">{$vo.title|msubstr=0,36}</a>
							</div>
							<span class="price">￥{$vo.price}</span>
							<div class="red">
								<span class="unit">￥</span><span class="promotion-price">{$vo.price}.<span
									class="small">0</span></span>
								<div class="action fr">
									<a href="{:U('Product/detail',array('id'=>$vo['id']))}">马上抢</a>
								</div>
							</div>
							<span class="count">已购:{$vo.sales}</span>
						</div>
					</div>
				</volist>			
			</div>
		</div>
	</div>
	
	<div class="col-xs-3 hot">
		<h5>热销产品</h5>
		<volist name="salestop" id="vo">				
			<div class="form-group auto-overflow">
				<a href="{:U('Product/detail',array('id'=>$vo['id']))}"><img src="{$vo.image}" /></a>
				<div class="fl info">
					<div class="title"><a href="{:U('Product/detail',array('id'=>$vo['id']))}">{$vo.title}</a></div>
					<div class="desc">
						<span class="price">￥{$vo.price}.00</span>
						<span class="sale fr">销量：{$vo.sales}</span>
					</div>
				</div>
			</div>
		</volist>		
	</div>
</div>
</block>